// :stack.h
#ifndef STACK_H
#define STACK_H
#include <iostream>
#include <cstdio>
#include <cstdlib>

using namespace std;

typedef int LElemType;

struct Node {
	LElemType data;
	struct Node* next;
};

struct LinkStack {
	Node *base;
	Node *top;
	int stacklength;
};

bool InitStack(LinkStack &S);

bool DestoryStack(LinkStack &S);

bool ClearStack(LinkStack &S);

bool StackEmpty(LinkStack S);

int StackLength(LinkStack S);

bool GetTop(LinkStack S, LElemType &e);

bool Push(LinkStack &S, LElemType e);

bool Pop(LinkStack &S, LElemType &e);

#endif
